<div class="col-xs-12 col-sm-6">
    <div class="form-group col-sm-10">
        <label>客户联系人: </label>
        <input type="hidden" name="row[contacts_id]" data-rule="required"  value="" >
        <div class="form-control">
            <a href="javascript:void(0)" class="select-contacts" data-name="row[contacts_id]"
               data-url="qingdongwms/customer/contacts/index?isselect=1"  >【请点击选择】</a>
        </div>

    </div>
</div>
<div class="col-xs-12 col-sm-10">
    <div class="form-group col-sm-10">
        <label for="c-address">所属地区:</label>
        <div class='control-relative'>
            <input id="c-address" class="form-control" data-toggle="city-picker" name="row[address]" type="text"
                   value="" placeholder="请选择所属地区"/>
        </div>
    </div>
</div>
<div class="col-xs-12 col-sm-10">
    <div class="form-group col-sm-10">
        <label>详细地址:</label>
        <textarea class="form-control" rows="3" name="row[desc]" placeholder="详细地址"></textarea>
    </div>
</div>

<div class="col-xs-12 col-sm-6">
    <div class="form-group col-sm-10">
        <label for="c-aftermarket">问题类型:</label>

        <select id="c-aftermarket" name="row[aftermarket_type_ids]" multiple="multiple"
                class="form-control selectpicker">
            {$aftermarket_type}
        </select>
    </div>
</div>
<table class="table table-responsive fieldlist" data-name="row[product_part]" data-template="testtpl2" data-tag="tr">
    <tr>
        <td>选择已购产品</td>
        <td></td>
    </tr>
    <tr>
        <td colspan="5"><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> 追加</a></td>
    </tr>
    <textarea name="row[product_part]" class="form-control hide" cols="30" rows="5">[]</textarea>
</table>
<table class="table table-responsive fieldlist" data-name="row[parts]" data-template="parttpl" data-tag="tr">
    <tr>
        <td>需携带配件</td>
        <td></td>
    </tr>
    <tr>
        <td colspan="5"><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> 选择配件</a></td>
    </tr>
    <textarea name="row[parts]" class="form-control hide" cols="30" rows="5">[]</textarea>
</table>

<div class="col-xs-12 col-sm-6">
    <div class="form-group col-sm-10">
        <label>过保类型:</label>
        {:build_radios('row[is_over]', ['1'=>__('过保'), '2'=>__('未过保')])}
    </div>
</div>
<!--定义模板，模板语法使用Art-Template模板语法-->
<script type="text/html" id="testtpl2">
    <tr class="form-inline">
        <td>
            <input type="hidden" name="row[<%=name%>][<%=index%>][customer_product_id]" value="<%=row['customer_product_id']%>" >
            <div class="form-control" style="width: 90%">

                <a href="javascript:void(0)" class="select-product"
                   data-name="row[<%=name%>][<%=index%>][customer_product_id]"
                   data-url="qingdongwms/customer/customer_product/index?isselect=1"  >
                    <% if(row['name']){%>
                    <%=row['name']%>
                    <% }else{%>
                    【请点击选择】
                    <% }%>
                </a>

            </div></td>

        <td style="width: 120px"><span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span> <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span></td>
    </tr>
</script>
<!--定义模板-->
<script type="text/html" id="parttpl">
    <tr class="form-inline">
        <td>
            <input type="hidden" name="row[<%=name%>][<%=index%>][id]" value="<%=row['id']%>" >
            <div class="form-control" style="width: 90%">

                <a href="javascript:void(0)" class="select-parts"
                   data-name="row[<%=name%>][<%=index%>][id]"
                   data-url="qingdongwms/parts/parts/index?isselect=1"  >
                    <% if(row['name']){%>
                    <%=row['name']%>
                    <% }else{%>
                    【请点击选择】
                    <% }%>
                </a>

            </div></td>
        <td style="width: 80px">
            <input type="number" name="row[<%=name%>][<%=index%>][number]" style="width: 80px"
                   class="form-control number" value="<% if(row['number']){%><%=row['number']%><% }else{%>1<% }%>" ></td>
        <td style="width: 120px"><span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span> <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span></td>
    </tr>
</script>
